<?php

namespace app\api\model;
use think\Model;
use think\Config;

class Integral extends Model
{
    protected $table = 'jk_user_integrals';

    //友好显示时间
    public function getCreateAtAttr($value)
    {
        $res = friendlyDate($value);

        return $res;
    }

    //来源类型
    public function getChannelAttr($value)
    {
        $status = [
            '1'=>'登录签到',
            '2'=>'注册赠送', 
            '3'=>'发布文章赠送',
            '4'=>'交易成功赠送', 
            '5'=>'邀请注册赠送',
            '6'=>'消费积分', 
        ];

        return $status[$value];
    }
}
